/*
 * Copyright (c) 2025 彭友聪
 * nativePC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2. 
 * You may obtain a copy of Mulan PSL v2 at:
            http://license.coscl.org.cn/MulanPSL2 
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.  
 * See the Mulan PSL v2 for more details.  
 * 
 * Author: 彭友聪 
 * email：2923616405@qq.com 
 * date: 2025/11/2 07:31
 * file: ${FILE_NAME}
 * product: DevEco Studio
 * LICENSE: MulanPSL-2.0
 * */
//
// Created on 2025/11/2.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef NATIVEPC_ARKUIIMAGENODE_H
#define NATIVEPC_ARKUIIMAGENODE_H
#include "ArkUINode.h"
#include <arkui/drag_and_drop.h>
namespace NativeModule { 
    class ArkUIImageNode : public ArkUINode {
        public:
            ArkUIImageNode() : ArkUINode(NativeModuleInstance::GetInstance()->GetNativeNodeAPI()->createNode(ARKUI_NODE_IMAGE)){}
			ArkUI_NodeHandle GetHandle() const  {
                return ArkUINode::GetHandle();
            }
			void SetImageSrc(){
				assert(handle_);
				ArkUI_AttributeItem item = {.string = "../../resources/rawfile/common/logo.png"};
                nativeModule_ -> setAttribute(handle_, NODE_IMAGE_SRC, &item);
			}
            void SetDraggable(bool draggable) {
                assert(handle_);
                OH_ArkUI_SetNodeDraggable(handle_, draggable);
            }
            void SetDragPreview(OH_PixelmapNative *pixelmap){
                assert(handle_);
                OH_ArkUI_SetNodeDragPreview(handle_, pixelmap);
            }
            void SetDragPreviewOption(ArkUI_DragPreviewOption* option){
                assert(handle_);
                OH_ArkUI_SetNodeDragPreviewOption(handle_, option);
            }
    };
}

#endif //NATIVEPC_ARKUIIMAGENODE_H
